local tool = script.Parent
local handle = tool.Handle
local equipped, holding = false, false

function getPlayer()
	return tool.Parent:IsA("Backpack") and tool.Parent.Parent.Parent or game.Players:GetPlayerFromCharacter(tool.Parent)
end

function onHandleTouched(other)
	local human = other.Parent:FindFirstChild("Humanoid")
	if not human then return end
	local player = game.Players:GetPlayerFromCharacter(other.Parent)
	if not player then return end
	
	
end

function onActivated()
	local BoneTrap = game.ServerStorage.BoneTrap
	local CloneTrap = BoneTrap:Clone()
    BoneTrap.Middle.Position=playercusor
end

function onDeactivated()
	
end

function onEquipped()
	
end

function onUnequipped()
	
end

tool.Equipped:connect(function (m) equipped = true onEquipped(m) end)
tool.Unequipped:connect(function () equipped = false onUnequipped() end)
tool.Activated:connect(function () holding = true onActivated() end)
tool.Deactivated:connect(function () holding = false onDeactivated() end)
handle.Touched:connect(onHandleTouched)

2 comments

0

i don't really understand code that much but. how do i move the model to where the player clicked without local script?

0

if its local script only. then how do i use events to work this out?