It seems to work in roblox studio but not in script builder please tell me why function Admin(msg) Player = script.Parent.Parent if Player.Name == "legomaster38" or Player.Name == "Friaza" then If msg == "god" then Player.Character.Humanoid.MaxHealth = math.huge Player.Character.Humanoid.Jump = true end end end script.Parent.Parent.Chatted:connect(Admin)
function Admin(msg) Player = script.Parent.Parent --This script would have to be directly in StarterGui or StarterPack. if Player.Name == "legomaster38" or Player.Name == "Friaza" then if msg:lower() == "god" then --Made the message lower, so it could be like this gOd and still work. Player.Character.Humanoid.MaxHealth = math.huge Player.Character.Humanoid.Health = math.huge --Want to set the health to max, or some guy could kill you when you say the command. Player.Character.Humanoid.Jump = true end end end script.Parent.Parent.Chatted:connect(Admin)
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if plr.Name == "legomaster38" and msg == "Jump" then plr.Character.Humanoid.Health = math.huge plr.Character.Humanoid.MaxHealth = math.huge Player.Character.Humanoid.Jump = true end) end)
If this answered your question check mark :) and if this helped +1
game.Players.PlayerAdded:connect(function(plr) --The PlayerAdded event if plr.Name:lower()==("NAME"):lower()then --If Player's name matches to Player's then (Switch NAME with yours) plr.Chatted:connect(function(msg) --plr.Chatted even if msg:lower()=="god"then --If the msg is god then if plr.Character:FindFirstChild("Humanoid")then --If script finds the Humanoid within plr's Character plr.Character.Humanoid.MaxHealth=math.huge --inf health plr.Character.Humanoid.Health=plr.Character.Humanoid.MaxHealth --Just like MaxHealth plr.Character.Humanoid.Jump=true --Player Jumps end end end) end end) --All the ends
I hope this helped!