Horse tool help

Not sure if you have seen this horse, many groups have this Horse tool, but… I have no idea how to set it up, since it’s not working properly, if you know how to solve this, please tell me.

Problem


It can be placed, but not be used

Script/Source

aaaaaaCapture aasdCapture

The script shown is part of the tool.

If you need any more information, please tell me, it can be the horse’s Scripts, Animations, and Seats… (The horse does work when it’s put on the workspace, but without the tool)

1 Like

Here’s the example when it’s used on the workspace without the tool

1 Like

In order for this to work you use Remote Events.
1.) To do this you need to add a Remote Event to Replicated Storage(name it RemoteEvent).
2.) In the tool script add the code below to fire the remote event with the name of the animal and the mouse position.

local remote = game.ReplicatedStorage.RemoteEvent
local animal = script.Parent.Name
local comn = script.Parent

function onEquippedLocal(mouse)

	if mouse == nil then
		print("Mouse not found")
		return 
	end

	mouse.Icon = ""
	mouse.Button1Down:connect(function()
		remote:FireServer(animal, mouse.hit.p + Vector3.new(0,1,0))
	end)	
end

comn.Equipped:connect(onEquippedLocal)

3.) Create a Script in ServerScriptService that contains the code to run when the event is fired.

local remote = game.ReplicatedStorage.RemoteEvent

function onButton1Down(plr, animal, Pos)
	if game.Workspace:FindFirstChild(plr.Name.."s".. " " .. animal) then	
		game.Workspace[plr.Name.."s".. " " .. animal]:remove()	
		local model = game.Lighting.Animals[animal]:clone()										 
		model.Parent = game.Workspace
		model.Name = plr.Name.."s".. " " .. animal
		model:MakeJoints()
		model:MoveTo(Pos)
	else
		local model = game.Lighting.Animals[animal]:clone()										 
		model.Parent = game.Workspace
		model.Name = plr.Name.."s".. " " .. animal
		model:MakeJoints()
		model:MoveTo(Pos)
	end	
end

remote.OnServerEvent:Connect(function(plr, animal, Pos)
	onButton1Down(plr, animal, Pos)
end)

4.) Test the place. If it still does not work download the Rbxl file here. Horse Tool.rbxl (109.5 KB) Hopefully this answered your question.

3 Likes

Great help! question, how do you make the horse tool to be “Destroyed” when you use it.
Meaning, once you use it, the tool is gone

1 Like

If you want to completely Destroy it in the local script after you fire the event you can do

script.Parent:Destroy()

But if you want to give them the tool back you would have to clone it and move it back to the players backpack. Also you may want to go to the tool and disable CanBeDropped if not the player can click Backspace and the tool disappears.

I don’t think… people will like to give another person a horse, xD