Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Car Gui dont works how will it work ???The script I got dont works,Gui dont gets cloned and moved

Asked by 7 years ago

I dont know why this script isnt working.I am new with programming and trying to make an Gui for an car,but bevor I try to add an Value the script it needs to Show up.


`script.Parent.Touched:connect(function(plr) game.ServerStorage.ScreenGui:Clone()t=plr.PlayerGui end) `

1 answer

Log in to vote
0
Answered by
Bazuxk 95
7 years ago
Edited 7 years ago

Use this method:


local TestGui = script.Parent[GUI'S NAME] script.Parent.Touched:Connect(function(t) local plr = game.Players:GetPlayerFromCharacter(t.Parent) -- Creates a new variable contains a player value if plr.Character and plr.PlayerGui:FindFirstChild('TestGui') then -- This will check if the player is alive and if he has the gui or not plr.PlayerGui:FindFirstChild('TestGui'):Destroy() TestGui:Clone().Parent = plr.PlayerGui print('Replaced',TestGui.Name) else TestGui:Clone().Parent = plr.PlayerGui print('Cloned',TestGui.Name) end end)

Make sure the script and the gui are inside the same parent.

If you this is too much for you, just look up at wiki.roblox.com as it has a very useful information for new people like you.

0
Thx,I learned in the last 2 Weeks much about Roblox Studio,and this is helping me alot. goldi111 -5 — 7y
Ad

Answer this question