I'm working on a system that when you click a player with the tool equipped, it changes a value in their PlayerScripts folder.
I feel like I've made a stupid mistake but I've tried almost everything and I can't get it to work. All the errors are PlayerScripts is not a valid member of Player.
My game is not filtering enabled, and the lines of code are in a LocalScript.
script.Parent.Equipped:connect(function(m)
m.Button1Down:connect(function()
local humanoid=m.Target.Parent.Humanoid
if humanoid then
local plr=game.Players:GetPlayerFromCharacter(humanoid.Parent)
if plr.PlayerScripts.CuffingSystem.Cuffed.Value==false then
plr.PlayerScripts.CuffingSystem.Cuffed.Value=true
else
plr.PlayerScripts.CuffingSystem.Cuffed.Value=false
end
end
end)
end)

3 comments
you can't make changes to another player. Try using remotes
Thank you so much, really helped.
yeah i didn't think about that