So I tried to use LoadCharacter() and apparently that doesn't work on local scripts, and using LocalPlayer doesn't work on scripts and I'm getting really confused now and I can't find and good answers on the internet. Can someone please expalin it?
Hi TMGOR,
Thanks,
Best regards,
~~ KingLoneCat
Here's the juice you should know:
Regular Scripts are server wide and using methods like GetPlayerFromCharacter (which, by the way, you can only call from game.Players) will work because every player can apply to that method. Using Scripts enables every player to see something and not just one player (like the for loop used for the PlayerGui).
Local Scripts only run on one player's computer and cannot be seen by other computers within a server. Directories such as "game.Players.LocalPlayer" are only compatible with LocalScripts and will NOT work with regular Scripts.
This is how you would use GetPlayerFromCharacter() by the way:
-- Regular Script local part = script.Parent bool = true part.Touched:Connect(function() bool = false local p = game.Players:GetPlayerFromCharacter(part) if p then print(p.Name.." has touched me!") end wait() bool = true end)