I don't understand. Here is the script, it is supposed to spawn in a surfboard.
character = script.Parent
humanoidrootpart = character:WaitForChild("HumanoidRootPart")
humanoid = character:WaitForChild("Humanoid")
leftfoot = character:WaitForChild("LeftFoot")
rightfoot = character:WaitForChild("RightFoot")
Player = game.Players.LocalPlayer
GUI = game.Workspace.RallysSurfShop.ShopToggle.ShowGUI.ScreenGui -- You might want to change this to whatever your GUI is.
guiclone = GUI:Clone()
game.Workspace.RallysSurfShop.ShopToggle.Touched:connect(function(hit)
if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then
local plr = game.Players[hit.Parent.Name]
if plr:FindFirstChild("PlayerGui") and not plr.PlayerGui:FindFirstChild(GUI.Name) then
guiclone.Parent = plr:FindFirstChild("PlayerGui")
guiclone.Enabled = true
end
end
end)
function destroyClone(hit)
guiclone.Enabled = false
end
game.Workspace.RallysSurfShop.ShopToggle.TouchEnded:Connect(destroyClone)
guiclone.Frame.ImageButton.MouseButton1Click:Connect(function(click)
guiclone.Visible = false
humanoidrootpart.CFrame = CFrame.new(42.852, 64.211, 52.145)
local leftfootweld = Instance.new("WeldConstraint", leftfoot)
local rightfootweld = Instance.new("WeldConstraint", rightfoot)
local boardclone = game.ReplicatedStorage.Boards.DefaultBoard:Clone()
boardclone.Parent = game.Workspace
boardclone.CFrame = leftfoot.CFrame - Vector3.new(0, .3, 0)
leftfootweld.Part0 = boardclone
leftfootweld.Part1 = leftfoot
rightfootweld.Part0 = boardclone
rightfootweld.Part1 = rightfoot
end)
