Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont this model relocator thing move the model into player model?

Ive asked this twice because no one answered on the last one

script.Parent.ChildAdded:connect(function(child)
	if (child.Name == "SeatWeld") then
		local Char = child.Part1.Parent
		local Human = game.Players:GetPlayerFromCharacter(Char)-- Relocate
		if (not Human) then
			return

		end
		local heli = script.Parent.Parent
		heli.Parent = game.Players.LocalPlayer.Character -- moves the heli into the player model
	end
end)

script.Parent.ChildAdded:connect(function(child) -- ignore this i made it like this
	while wait(0.2) do
		if script.Parent:FindFirstChild("SeatWeld") == nil then -- Checks if the seatweld is there or not
			local Char = child.Part1.Parent
			local Human = game.Players:GetPlayerFromCharacter(Char) -- Locate out (if left seat)
		if (not Human) then
			return
		end
		local heli = script.Parent.Parent
		heli.Parent = game.Workspace -- moves the heli out of the player model
		end	
	end
end)

This is placed in a seat. It works perfectly fine in studio but in server mode, the helicopter model doesn't move into the player model.

1 answer

✓ Accepted answer

You are using the wrong method on line 10: game.Players.LocalPlayer in studio is you, it exists, but in server mode, this script has to be a normal script inside workspace,

and let's replace that line 10 to:

heli.Parent = Human.Character

If it doesn't work, i don't know what doesn't. ~marcoantoniosantos3

1 comment

0

Finally! it worked! thank you...

This discussion is preserved as it was. New answers, comments, and votes are closed.