Advertisement
OnFireRobloxScriptin

Drop Tool Server Script

May 18th, 2025
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --//Variables
  2. local replicatedStorage = game:GetService("ReplicatedStorage") --Variable for Replicated Storage
  3. local DropEvent = replicatedStorage:WaitForChild("DropEvent") --Variable for Remote Event
  4.  
  5. --//Functions
  6. DropEvent.OnServerEvent:Connect(function(player) --When Server recieves the Remote Event, find the Player
  7.     local character = player.Character --Find the player's character
  8.     local tool = character:FindFirstChildOfClass("Tool") --Find the tool in character
  9.    
  10.     if tool then --If the script found a tool then
  11.         local originalCFrame = tool.Handle.CFrame --Stores Original Tool Position
  12.         tool.Handle.CanTouch = false --Can't touch the tool
  13.         tool.Parent = workspace --Put tool in workspace
  14.         tool.Handle.CFrame = originalCFrame --Position tool in original position
  15.         task.wait(1) --Wait 1 second
  16.         tool.Handle.CanTouch = true --Can touch the tool again
  17.     end
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement