I am trying to find out why my module script stops me from sitting in the seat if i just place the boat in workspace it let’s me sit in it without the script but if i use the script to tp me to sit in it i just can’t sit even if i walk on the seat.
if you find any errors and would like to rewrite then for me i would really love if you could i have been trying to fix it for 2 days i’m very lost please and thank you!
local SpawnBoat = {}
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local Boat = ReplicatedStorage.Boats.Boat
function SpawnBoat:SpawnPlayersBoat(Player1, Player2)
if not Player1.Character or not Player2.Character then
warn("One or both players don't have a character!")
return
end
local currentboat = Boat:Clone()
currentboat.Parent = Workspace.PlayersBoats
currentboat.CFrame = Workspace.FinalBoatSpawn.CFrame
local drivePart = currentboat.Drive
local steerPart = currentboat.Steer
local humanoid1 = Player1 and Player1.Character and Player1.Character:FindFirstChildOfClass("Humanoid")
local humanoid2 = Player2 and Player2.Character and Player2.Character:FindFirstChildOfClass("Humanoid")
if humanoid1 then humanoid1.WalkSpeed = 0 end
if humanoid2 then humanoid2.WalkSpeed = 0 end
task.wait(1)
if Player1.Character and Player1.Character.PrimaryPart then
Player1.Character.PrimaryPart.CFrame = drivePart.CFrame
end
if Player2.Character and Player2.Character.PrimaryPart then
Player2.Character.PrimaryPart.CFrame = steerPart.CFrame
end
if humanoid1 then humanoid1.WalkSpeed = 16 end
if humanoid2 then humanoid2.WalkSpeed = 16 end
end
return SpawnBoat