I have a script that does some certain codes for my ATM Machine, Near the end I am cloning a LocalScript and wanting to put it in the LocalPlayer's PlayerGui, When I put it in the hit.Parent(The character's model) It doesn't work, So I have to do PlayerGui but I've tried a lot of things and none of them worked, Here is the script and the second part is the part that won't work:
local ATMPart = script.Parent
debounce = false
wait ()
ATMPart.Touched:connect(function(hit)
if debounce == true then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Torso = hit.Parent.Torso
local ATM = game.Workspace.ATM
debounce = true
if player and hit.Parent:FindFirstChild("Card") then
wait ()
hit.Parent.Humanoid.WalkSpeed = 0
wait (0.5)
Torso.CFrame = CFrame.new(Torso.Position, ATM.Position)
wait (0.2)
hit.Parent.Humanoid.WalkSpeed = 10
wait (0.1)
local new_script = script:findFirstChild("LocalScript"):Clone()
new_script.Parent = game.StarterPlayer.StarterCharacterScripts
while wait() do
local ATM = game.Workspace.ATMLine.Position
hit.Parent.Humanoid:MoveTo(ATM)
wait (4)
while false do
end
end
hit.Parent.Humanoid.WalkSpeed = 0
wait (5)
debounce = false
end
end)
local new_script = script:findFirstChild("LocalScript"):Clone()
new_script.Parent = game.StarterPlayer.StarterCharacterScripts
There isn't any errors or anything just idk how to put it in the player's gui, I looked at websites and SH.
