Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Used the changed function wrong or I did the script wrong? [closed]

Asked by
Hydrogyn 155
8 years ago

Here's the code I did. [Attempt 1] [ Game does not have FE enabled, for all attempts ]

1game:GetService("Players").LocalPlayer.Backpack.Tool.Parent.Changed:connect(function()
2    local plr = game:GetService("Players").LocalPlayer.Character.Name
3    if game:GetService("Players").LocalPlayer.Backpack.Tool.Parent == game:GetService("Players").LocalPlayer.Character.Name then
4        script.Parent:FindFirstChild("Frame").Visible = true
5    else
6        script.Parent:FindFirstChild("Frame").Visible = false
7    end
8end)

I maybe used the Changed function in a wrong way, but I changed a bit of things

1game:GetService("Players").LocalPlayer.Backpack.Tool.Parent.Changed:connect(function()
2    local plr = game:GetService("Players").LocalPlayer.Character.Name
3    if game:GetService("Players").LocalPlayer.Backpack.Tool.Parent == plr then
4        script.Parent:FindFirstChild("Frame").Visible = true
5    else
6        script.Parent:FindFirstChild("Frame").Visible = false
7    end
8end)
0
Nvm, I found my mistake. Thanks for helping no one... Hydrogyn 155 — 8y

Locked by RubenKan

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?