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

LocalScript isn't working properly, no error in output?

Asked by 5 years ago
local plr = game.Players.LocalPlayer
local event = game.ReplicatedStorage.BuyEvent
local item = script.Parent.Parent.SelectedItem.Value
local price = script.Parent.Parent.ScrollingFrame:WaitForChild(item).Price.Value

script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Text ~= "Owned" and game.ReplicatedStorage:WaitForChild(plr)[item].Value ~= true and plr.leaderstats.Money >= price then
        event:FireServer(item, price)
        script.Parent.Text = "Owned"
    end
end)

any idea because I'm stumped

0
Line 7. User#19524 175 — 5y
0
WaitForChild(plr)[item].Value is it supposed to be like this? Because item variable already has .Value xxXTimeXxx 101 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago

When you typed waitforchild it should have quotations around the name. Also you need to tell us what the error message was

Waitforchild("name")

0
This is wrong, you don't necessarily need strings around waitforchild if the name is already a string LORD_BIGHEAD 10 — 5y
Ad

Answer this question