Hi, I'm using a IntValue to bind 2 scripts together. The Name of the IntValue is "SpeedValue" and the function of the scripts is to change the Walk speed of Players. 1 script uses onTouch and the other uses onChatted.
Here is Script 1:
local BasePlate = script.Parent
local Speed = game.Workspace.SpeedValue.Value
BasePlate.Touched:connect(function(Brick)
local Player = Brick.Parent:findFirstChild("Humanoid")
Player.WalkSpeed = Speed
end)
and Here is Script 2:
local Speed = game.Workspace.SpeedValue.Value
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
msg.Text = Speed
end)
end)
The Problem I'm having is that I'm fairly new to onChatted and the Wiki was no help (seriously I read through it like 4 times). I the output displays: "Workspace.Speed Command:4: attempt to index local 'msg' (a string value)"
Thanks.

1 comment
Thanks, I'm just messing about with chat Commands and I thought using Speed might a fun way to go about it. I used a Int Value because I thought it would be helpful in connecting 2 scripts.