I want to make the GUI clonable only 1 time when touched not more. how can i do that ?
Camera = script.Parent.Parent.Parent.Camera1.Camera
local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
local check = hit.Parent:FindFirstChild("Humanoid")
local character = game.Players.LocalPlayer.Character
if check ~= nil then
check.WalkSpeed = 0
character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
player = game.Players:findFirstChild(check.Parent.Name)
game.Workspace.Camera.CameraSubject = Camera
game.Workspace.Camera.CameraType = 1
exitgui = script.Parent.exitgui:clone()
exitgui.Parent = player.PlayerGui
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)
GUI Script
character = game.Players.LocalPlayer.Character
function Click(click)
local player = game.Players.LocalPlayer
if player == nil then return end
game.Workspace.Camera.CameraSubject = player.Character.Humanoid
game.Workspace.Camera.CameraType = 3
player.PlayerGui:findFirstChild("exitgui"):remove()
character:WaitForChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
character.Humanoid.WalkSpeed = 16
end
script.Parent.MouseButton1Click:connect(Click)
need help with walkspeed in GUI script please

7 comments
You're gonna have to explain a bit more. What's your code supposed to do, and what is it actually doing?
What it does when player touches this. It clones a gui into him and makes the camera set on an brick. Then when he wants to exit it he clicks the GUI. Mine problem is that i get 3 guis or 2 guis cloned which i want it to be cloned ONCE so it's like if he touches it 3 times clones it only once and checks if theres more guis it deletes it thats what i want it to do.
Also how can i make the camera locked so the player can't scroll out or rotate it ? with right click holding
Please fix this script i really want to know and i need this is an important script for me !
Is this a local script?
You could just insert a value into the player, so when they hit the part the Value goes up therefore meaning you can't take the script anymore
i don't know how to do that.... i've fixed this problem now the problem is that it works only in solo but not in server or online