Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Steam Games Hacks & Cheats › Garry's Mod Hacks & Cheats › Garry's Mod Coding & Resources › Gmod lua player material (first script)

QuestionGmod lua player material (first script)

Posts 1–7 of 7 · Page 1 of 1
im moox
im moox
Gmod lua player material (first script)
So, I made my first simple lua script for Garry's Mod that sets my player material. But other players can't see it and I was wondering if there was a way to fix it to make it visible to other players. Thanks!

Btw, here's the code--
 
Show code

O = "\nLua Script (first one)\n\n"
N = "\n"
local Ply = LocalPlayer()

MsgC(Color(25,152,255),O)

chat.AddText(Color(70,255,30),"Type !Mat to set your material, and type !Clr to reset it.")

hook.Add( "OnPlayerChat", "HelloCommand", function( ply, strText )

if ( strText == "!Mat" ) then
Ply:SetMaterial("models/debug/debugwhite")
chat.AddText(Color(255,10,10),"[ALRT]: ",Color(25,152,255),"Material applied.")
return true
end
if (strText == "!Clr") then
Ply:SetMaterial("")
chat.AddText(Color(255,10,10),"[ALRT]: ",Color(25,152,255),"Material Reset.")
return true
end
end )

MsgC(Color(255,255,255),"hi ",Ply:Name(),"\n","Ping: ",Ply:Ping(),N,"SteamID: ",Ply:SteamID(),N)
#1 · 9y ago
TE
tehhkp
If this is serious, running it clientside won't affect your material for other clients, this would have to be ran on the server for other clients to be able to see it which would require access to the server itself. I recommend you learn Lua and basic clientside/serverside concepts before continuing to make "simple lua script"'s.
#2 · 9y ago
anteskka
anteskka
Quote Originally Posted by tehhkp View Post
If this is serious, running it clientside won't affect your material for other clients, this would have to be ran on the server for other clients to be able to see it which would require access to the server itself. I recommend you learn Lua and basic clientside/serverside concepts before continuing to make "simple lua script"'s.
learning basic lua is literally the exact reason he would and should make simple lua scripts
#3 · 9y ago
Cyaegha
Cyaegha
You'd need to use a net message to broadcast it to all the clients connected to the server.
#4 · 9y ago
anteskka
anteskka
Quote Originally Posted by Cyaegha View Post
You'd need to use a net message to broadcast it to all the clients connected to the server.
why would you use net when you can just call ply:SetMaterial serverside
#5 · edited 9y ago · 9y ago
Gorzoid
Gorzoid
Quote Originally Posted by anteskka View Post
why would you use net when you can just call ply:SetMaterial serverside
or just upload to a webserver the path of the material + ip then client downloads the path by giving ip aswell. jeeze no need to make things difficult guys.
#6 · 9y ago
Smoke
Smoke
Been over a week since last update/bump after answers, assuming solved.

/Closed.
#7 · 9y ago
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

  • Gmod lua money scriptBy Zorro31 in Garry's Mod Discussions & Help
    11Last post 11y ago
  • Gmod Lua scripts?By RedDead36 in Garry's Mod Discussions & Help
    1Last post 11y ago
  • Progress on my first script for RSBotBy Shakugan no Shana in Runescape Hacks / Bots
    12Last post 15y ago
  • My First Script CodeBy Paul in RuneScape Discussions
    19Last post 15y ago
  • Zombies single player video - First gameplay commentary ever!By Locke in Call of Duty Black Ops Discussions
    5Last post 14y ago

Tags for this Thread

None