Alright,
I’ve made a boat spawner that works well. But, i’m trying to make it so that after you’ve clicked the Button on the GUI to spawn it, the character is teleported to the new cloned vehicle’s VehicleSeat.
Here’s what i’ve tried so far. The GUI comes up after pressing a spawn block thing, so it uses a regular script first to give you the GUI. The script below is the regular script inside of the button for the ship you want to spawn.
local player = game.Players.LocalPlayer
local humrootpart = player.Character.HumanoidRootPart
script.Parent.MouseButton1Click:Connect(function()
local ship = game.ServerStorage.Ships.Ferecua.IslandClass
local clone = ship:Clone()
local seat = clone.VehicleSeat
clone.Parent = workspace
humrootpart.CFrame.new = seat.CFrame
script.Parent.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Parent.Parent.ClickDetector.MaxActivationDistance = 0
wait(30)
script.Parent.Parent.Parent.Parent.Parent.ClickDetector.MaxActivationDistance = 32
end)
Workspace.GameFolders.Spawners.Ferecua.DisburnSpawner.ScreenGui.Outer.Inner.IslandClass.Script:2: attempt to index nil with 'Character' - Server - Script:2
When I test it, I am presented with "attempted to index nil with ‘Character’, even though its a valid property inside of the player? i’m not sure if it’s because it’s a regular script or…
Any help would be appreciated, this is my first time trying to make this sort of thing.