this has really been pissing me off ive tried to get this stupid thing to work for an hour and i dont know why it wont. Ive tried like everything and nothing works.
if anyone knows why please tell me whats wrong with it
script.Parent.Touched:Connect(function(hit) local player = hit.Parent local playerp = game.Players:FindFirstChild(player.Name) if playerp then if playerp == script.Parent.Owner.Value then game:GetService("ReplicatedStorage").RemoteEvents.Workplace1JobEvent:FireClient(player) else print"player does not own" end else print"no player found" end end) script.Parent.TouchEnded:Connect(function(hit) local player = hit.Parent local playerp = hit.Parent:FindFirstChild("Humanoid") if playerp then print(player) if player.Name == script.Parent.Owner.Value then game:GetService("ReplicatedStorage").RemoteEvents.Workplace1JobEvent.End:FireClient(player) else print"player does not own" end else print"no player found" end end)
i decided to move it all local to the player instead of a remote event and it works just fine now.
For printing you gotta do
print("diwn aaodn ad ")
Use () on your strings..
I think there is no issue with the script except the printing part.
Here is the print syntax you must use print(int, object.. ext)
or print("STRING")
So your code should be written like that:
script.Parent.Touched:Connect(function(hit) local player = hit.Parent local playerp = game.Players:FindFirstChild(player.Name) if playerp then if playerp == script.Parent.Owner.Value then game:GetService("ReplicatedStorage").RemoteEvents.Workplace1JobEvent:FireClient(player) else print("player does not own") end else print("no player found") end end) script.Parent.TouchEnded:Connect(function(hit) local player = hit.Parent local playerp = hit.Parent:FindFirstChild("Humanoid") if playerp then print(player) if player.Name == script.Parent.Owner.Value then game:GetService("ReplicatedStorage").RemoteEvents.Workplace1JobEvent.End:FireClient(player) else print("player does not own") end else print("no player found") end end)