i have tried to do this for about a day or two but nothing i have works and mind you i used the code on the intro to player tools where they make the wand to help me understand this and when i use its code the "clickEvent" is not a valid part of "tool" i have edited the local clickEvent = tool.clickEvent to local clickEvent = tool.activated but then i found out that the fireserver script in the wand roblox made was no longer work i am a nub when coding and was thinking somebody here would help me understand how to do this oh heres the scripts th sed that wouldn't work for me so i can get a good idea of what to do
- -- Local Script - local tool = script.Parent - local player = game.Players.LocalPlayer - local mouse = player:GetMouse() - local clickEvent = tool.ClickEvent - local function onActivate() - local clickLocation = mouse.Hit - clickEvent:FireServer(clickLocation) - end - tool.Activated:connect(onActivate) - tool.Activated:connect(onActivate) - - -- Server Script - local tool = script.Parent - local clickEvent = tool.ClickEvent - local clickEventConnection - local function createPart(location) - local part = Instance.new("Part") - part.CFrame = location - part.Parent = workspace - end - local function onClick(player, clickLocation) - createPart(clickLocation) - end - local function onEquip() - clickEventConnection = clickEvent.OnServerEvent:connect(onClick) - end - local function onUnequip() - clickEventConnection:disconnect() - end - tool.Equipped:connect(onEquip) - tool.Unequipped:connect(onUnequip)