bin = script.Parent function onButton1Down(mouse) local player = game.Players.LocalPlayer local model = bin.Horse:clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(player.Character.Head.Position + Vector3.new(0, 0, 5)) bin:Remove() end function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end bin.Selected:connect(onSelected)
Thats the script of the tool. The horse works when already placed in the workspace. When I use the tool, the horse spawns but the seat will not work. Keep in mind this is on Filtering Enabled.
https://gyazo.com/31790e5ffe2a68ab2a651bb7e5fd029c
You can read more about FE right here. In short, it seperates the client from the server. Although it shows you the new horse spawned in the client, it is not actually in the server, making the seat not actually exist. The seat is a server sided item. In order to fix this, simply use a remote event. You can read about them here. Here is an example of a basic way to make your code work, using remote events:
-- local script inside of 'bin' bin = script.Parent local remote = game.ReplicatedStorage['Name of your remote'] function onButton1Down(mouse) remote:FireServer(bin) -- pass the argument bin, as it is needed in the code end function onSelected(mouse) mouse.Button1Down:Connect(function() -- make the c a capital C in Connect. onButton1Down(mouse) end) end bin.Selected:Connect(onSelected)
Then, a server sided script (Just place this script under ServerScriptStorage):
local remote = game.ReplicatedStorage['Name of your remote'] remote.OnServerEvent:Connect(function(Player, bin) local model = bin.Horse:Clone() -- Make it Clone, not clone model:MoveTo(Player.Character.Head.Position + Vector3.new(0, 0, 5)) model.Parent = workspace model:MakeJoints() bin:Destroy() -- use Destroy, not remove, unless you actually know the difference and have a good reason for it (unlikely) end)
I hope I helped, and have a good day!