Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

Line 7.

0

WaitForChild(plr)[item].Value is it supposed to be like this? Because item variable already has .Value

1 answer

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

Waitforchild("name")

1 comment

0

This is wrong, you don't necessarily need strings around waitforchild if the name is already a string

This discussion is preserved as it was. New answers, comments, and votes are closed.