Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

What is wrong my chatted script??

Asked by 10 years ago

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)

0
please give me a reply. legomaster38 39 — 10y
0
Use script box please. HexC3D 830 — 10y

3 answers

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago
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)
Ad
Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
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

0
thank you legomaster38 39 — 10y
Log in to vote
0
Answered by 10 years ago
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!

Answer this question