What is wrong with my script?
That’s line 13
function FindSkiers(hit)
if hit.Parent:FindFirstChild("Humanoid") then --Line 13
return true
end
end
ski.Touched:Connect(FindSkiers)
local isPlayerOnSki = FindSkiers()
If you want the whole script, then:
local goal = game.Workspace.goal
local ski = game.Workspace.ski
local skiPos = game.Workspace.skiPos
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(15, Enum.EasingStyle.Linear)
local goal = {CFrame = goal.CFrame}
local goal2 = {CFrame = skiPos.CFrame}
local Tween = tweenService:Create(ski, tweenInfo, goal)
local Tween2 = tweenService:Create(ski, tweenInfo, goal2)
local IsTweening = false
function FindSkiers(hit)
if hit.Parent:FindFirstChild("Humanoid") then
return true
end
end
ski.Touched:Connect(FindSkiers)
local isPlayerOnSki = FindSkiers()
if isPlayerOnSki then
if IsTweening == false then
IsTweening = true
Tween:Play()
Tween.Completed:Connect(function()
Tween2:Play()
Tween2.Completed:Connect(function()
IsTweening = false
end)
end)
end
end
Thank you!