hi, im trying to get a boat to spawn from a simple gui when a player clicks a button, though the remotefunction doesnt seem to work too well as the script is casting a weird attempt to index nil value error when it doesnt try to index any value at all, all its trying to do is send a invokeserver, ive tried without the "boat" part in the invokeserver event
Output: 18:14:35.653 - Workspace.BSPP1.Script:13: attempt to index a nil value 18:14:35.654 - Stack Begin 18:14:35.654 - Script 'Players.misterviggo.PlayerGui.BoatSpawnGui.LocalScript', Line 11 18:14:35.654 - Stack End
BSel = script.Parent.BoatSelector
BFrame = script.Parent.BaseFrame
BGUI = script.Parent
ExBut = script.Parent.BaseFrame.ExitButton
ExBut.MouseButton1Click:Connect(function()
BGUI.Enabled = false
end)
BSel.MBoat1.MouseButton1Click:Connect(function()
game.Workspace.BSPP1.SpawnReFunction:InvokeServer("Boat")
end)
Server Script:
Spawnable = 0
Coordinates = 153.375, 71.75, 43
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
end
end)
script.Parent.SpawnReFunction.OnServerInvoke = function(Boat)
if Spawnable == 0 then
local BReplica = game.ReplicatedStorage:FindFirstChild(Boat):Clone()
BReplica.Name = Boat
BReplica.Parent = game.Workspace
BReplica:SetPrimaryPartCFrame(CFrame.new(Coordinates))
end
end

3 comments
You don't know what you are talking about, you are attempting to index a nil value. You probably don't know how but you're doing it. Lua wouldn't lie for no reason. The issue is happening on the server script, make sure to send that as well
no the error guides me here but ill comment it
ill just send it as a answer as this didnt turn out too well