I really don't know what to do. I've tried doing local Player = game.Players.LocalPlayer instead of this code, but it said it must be a Player object.
local debounce = false
function onTouched(part,Player)
if debounce == false then
if part.Name == "Handle" then
debounce = true
script.Parent.GlassBreak:Play()
script.Parent.Transparency = 1
script.Parent.CanCollide = false
game.ReplicatedStorage.PharmacyVandalism:FireClient(Player)
wait(.1)
debounce = false
end
end
end
script.Parent.Touched:Connect(onTouched)

6 comments
00:58:48.588 - players is not a valid member of DataModel
try game:GetService("Players"):FindFirstChild(part.Parent.Name)
i edited the script to show the changes
It doesn't work. The code isn't even executed.
Any output? @royaltoe why are you editing my answers without my permission? Your edit is also completely redundant since the method GetPlayerFromCharacter has perfect usage here. Your own implementation doesn’t differ the result.
There is no output