#if player holds a certain tool in his hand then
1 messages · Page 1 of 1 (latest)
when i hold a block called sand(its a tool) and u press e i want that u will get another tool and the send will get taken out
what the
is it my reading comprehension or i just dont understand what youre trying to say
raw
lets say you have a tool named sand in ur hand, and u want to trade it for another item
so i want it to get taken and the player will get another item
just do script.Parent.Equipped:Connect(function()
** You are now Level 2! **
fym doesnt work broski
i want to create a crafting systeam like grow a garden
you put sand, wait 10 second and get clay
i've never played grow a garden
like you press e with the tool in hand and wait 10 second and you get something else
okay so put a local script into the tool
what script exectly?
bro its not my fault ur an idiot
** You are now Level 10! **
but dude i know what local script mean i just dont know what to type
local UIS = game:GetService('UserInputService')
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and script.Parent.Parent:FindFirstChild("Humanoid") then --Checks if the key that the player pressed was E and if the tool is being held out.
wait(10)
end
end)
here i wrote this out for you
where is the other tool that will be replaced at
replicated storage/
?
yes
after the if statement put this
local char = script.Parent.Parent
wait(10)
local newTool = game:GetService("ReplicatedStorage").TOOLNAME:Clone()
newTool.Parent = game.Players:GetPlayerFromCharacter(char).Backpack
and replaced toolname with the name of the tool
local UIS = game:GetService('UserInputService')
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and script.Parent.Parent:FindFirstChild("Humanoid") then
local char = script.Parent.Parent
wait(10)
local newTool = game:GetService("ReplicatedStorage").TOOLNAME:Clone()
newTool.Parent = game.Players:GetPlayerFromCharacter(char).Backpack
end
end)
this is it all put together
yeah it doesnt work man
did u wait 10 seconds
is there an error
ok it work thanks dude
but do you know how to stack tools?
this guy isnt smart
