I was making game, and I noticed that it detects only when I have unequipped item, but when I have equipped item then it don’t detect.
When I will unequip, it goes to player.Backpack, but i don’t know where it goes if i will equip item. You can see on this video what I meant.
robloxapp-20220926-0924218.wmv (2,8 MB)
The item goes inside the character when it’s equipped. (player.Character)
That’s weird. There was also player.Character, but it didn’t detects. I will check fast what’s wrong.
Cynacol
(Cynacol)
September 26, 2022, 7:39am
#4
in a local script inside the tool
script.Parent.Equipped:Connect(function()
local character = script.Parent.Parent
-- or a better version
local character = game:GetService("Players").LocalPlayer.Character
end)
I think this is the code you are looking for.
@colbert2677 is correct, when you have a tool equipped it is a child of the character. Try this:
local Tool = player.Backpack:FindFirstChild("ToolName") or player.Character:FindFirstChild("ToolName")
if Tool then
-- allow past checkpoint
end
Hope this helped!
i found a script, but when there is player.Character, it’s still not working. idk what’s wrong. there is player.Character, but it didn’t detects anyway.
for _,v in pairs(player.Character:GetChildren()) do
if touched == false then
if v:IsA("Tool") then
Cynacol
(Cynacol)
September 26, 2022, 7:54am
#7
First, where are you putting this script? What type of script is it?
I used LocalScript, because i wanted to give badge Badge:FireServer()
and gui showing.
Try checking if Character exists. If not, wait.
local character = player.Character or player.CharacterAdded:Wait()
Cynacol
(Cynacol)
September 26, 2022, 8:02am
#10
ok good so now
for _,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if touched == false then
if v:IsA("Tool") then
Still no luck. I tried (SuperDeusterMan) script and yours and don’t work. also, I am using R6 Character.
Tool goes into the character when you equip it
Alright. I fixed it by fixing some problems.