Okay so, this script shows the gui for every player in the game when a player touch it. I just want to show it for the player who touch
(I tried to make it work from server script (Of course I changed local player part to fire:Client remote event) But if I put it to server script it won’t work properly. If there is 3 player touching the part at the same time then other 2 player can’t see the gui until first touched player stops touching) if it possible I would rather to make it from server side
this is a local script
local players = game:GetService("Players")
local ScriptableFolder = game.Workspace:FindFirstChild("SccriptYapılabilirObjeler")
local replicatedStorage= game:GetService("ReplicatedStorage")
local remotes = replicatedStorage:WaitForChild("Remotes")
local db = true
ScriptableFolder.MagazaAcar.Touched:Connect(function(hit)
local player = players.LocalPlayer
if hit.Name == "HumanoidRootPart" and db== true then
player.PlayerGui.Shopik.Enabled = true
local connection do
db= false
connection = ScriptableFolder.MagazaAcar.TouchEnded:Connect(function(hitEnd)
if hit == hitEnd then
local hitModel = hitEnd:FindFirstAncestorOfClass("Model")
if hitModel then
local hitPlayer = players:GetPlayerFromCharacter(hitModel)
if hitPlayer then
print(hitEnd.Name.." stopped touching part.")
db = true
end
end
end
end)
print("We got the Data Bro Relax")
end
end
end)