I had never used a TouchEnded before,so I need a script,not a hint.My problem is idk how to make a gui appear when touch a part.I have scripts when touch a part the gui will appear:
in the replicatedStorage ther is a remote event
a script in SeverScriptService:
game.Workspace.Shop.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent)then game.ReplicatedStorage.RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent)) end end)
and a script in the gui:
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function() script.Parent.Main.Visible = not script.Parent.Main.Visible end)
This might work:
game.Workspace.Shop.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent)then game.Workspace.Shop.Touched:Wait() game.ReplicatedStorage.RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent)) end end)