For some reason my script for my jail disables all players tools, I only want it to disable it for the player who touches the part. Is there any way to fix this?
Image:
For some reason my script for my jail disables all players tools, I only want it to disable it for the player who touches the part. Is there any way to fix this?
Image:
It looks like you are using a localscript for this, this happens because you are not verifying who touched the part, so it thinks that everyone should be affected
A great post was made about this issue and how to remedy it
Basically you need at least some sort of verification to make it work, example
local part = script.Parent
part.Touched:Connect(function(hit)
part.Transparency = 1
end)
Here still will make it invisible for everyone if one person touches it, but if we do
local part = script.Parent
local plr = game:GetService("Players").LocalPlayer
part.Touched:Connect(function(hit)
if not plr.Character or not hit:IsDescendantOf(plr.Character) then return end
part.Transparency = 1
end)
This does work for the player who touches it but not everyone else because we verified who touched it
Where would I put this in my script?
I gave you a brief way to verify touches, you have to change it around for your code
I was looking for this in my game, I appreciate the help!
Works well!
Glad I could help out another person whilst trying to help another haha!
Yes, but you forgot to write hit
in the function()
I edited it, should it work now?
Yes, should work, try it out and see how it goes!
Thank you so much, it works perfectly!
Anytime! if you have anymore issues don’t be afraid to make another post!