my code:
workspace.buildgui.Value = 0
script.Parent.Parent.Enabled = false
local SP = script.Parent
local slideno = 0
local goleft = script.Parent.goleft
local goright = script.Parent.goright
local buildingsnames = {"hut","stone hut"}
while true do
wait(0.5)
if game.Workspace.buildgui.Value == 1 then
script.Parent.Parent.Enabled = true
if slideno == 0 then
SP.Dinfo.BackgroundTransparency = 1
SP.Dinfo.Text = ""
SP.Dbuy.BackgroundTransparency = 1
SP.Dbuy.Text = ""
SP.Einfo.BackgroundTransparency = 1
SP.Einfo.Text = ""
SP.Ebuy.BackgroundTransparency = 1
SP.Ebuy.Text = ""
SP.Finfo.BackgroundTransparency = 1
SP.Finfo.Text = ""
SP.Fbuy.BackgroundTransparency = 1
SP.Fbuy.Text = ""
SP.Ginfo.BackgroundTransparency = 1
SP.Ginfo.Text = ""
SP.Gbuy.BackgroundTransparency = 1
SP.Gbuy.Text = ""
SP.Hinfo.BackgroundTransparency = 1
SP.Hinfo.Text = ""
SP.Hbuy.BackgroundTransparency = 1
SP.Hbuy.Text = ""
SP.Ainfo.BackgroundTransparency = 0
SP.Ainfo.Text = "info"
SP.Abuy.BackgroundTransparency = 0
SP.Abuy.Text = "buy"
SP.Binfo.BackgroundTransparency = 0
SP.Binfo.Text = "info"
SP.Bbuy.BackgroundTransparency = 0
SP.Bbuy.Text = "buy"
SP.Cinfo.BackgroundTransparency = 1
SP.Cinfo.Text = ""
SP.Cbuy.BackgroundTransparency = 1
SP.Cbuy.Text = ""
SP.Cimage.Visible = false
SP.Dimage.Visible = false
SP.Eimage.Visible = false
SP.Fimage.Visible = false
SP.Gimage.Visible = false
SP.Himage.Visible = false
SP.Aimage.Visible = true
SP.Bimage.Visible = true
function onclickbuy(letter)
if letter == "A" then
print("bfhsfhsljchl;s")
if workspace.hosuesbrought.A.Value == 0 then
game.ReplicatedStorage.Abuy.Parent = workspace
workspace.hosuesbrought.A.Value = 1
end
end
end
script.Parent.Abuy.MouseButton1Click:Connect(onclickbuy("A"))
end
end
if workspace.buildgui.Value == 0 then
SP.Parent.Enabled = false
end
end
the bit wrong is this:
function onclickbuy(letter)
if letter == "A" then
print("bfhsfhsljchl;s")
if workspace.hosuesbrought.A.Value == 0 then
game.ReplicatedStorage.Abuy.Parent = workspace
workspace.hosuesbrought.A.Value = 1
end
end
end
script.Parent.Abuy.MouseButton1Click:Connect(onclickbuy("A"))
when i run this happens 16:25:11.648 - Attempt to connect failed: Passed value is not a function 16:25:11.649 - Stack Begin 16:25:11.650 - Script 'Players.codingMASTER398.PlayerGui.ScreenGui.Frame.LocalScript', Line 62 16:25:11.650 - Stack End bfhsfhsljchl;s 16:25:12.164 - Attempt to connect failed: Passed value is not a function 16:25:12.164 - Stack Begin 16:25:12.165 - Script 'Players.codingMASTER398.PlayerGui.ScreenGui.Frame.LocalScript', Line 62 16:25:12.165 - Stack End bfhsfhsljchl;s 16:25:12.700 - Attempt to connect failed: Passed value is not a function 16:25:12.701 - Stack Begin 16:25:12.702 - Script 'Players.codingMASTER398.PlayerGui.ScreenGui.Frame.LocalScript', Line 62 16:25:12.702 - Stack End bfhsfhsljchl;s 16:25:13.214 - Attempt to connect failed: Passed value is not a function 16:25:13.214 - Stack Begin 16:25:13.215 - Script 'Players.codingMASTER398.PlayerGui.ScreenGui.Frame.LocalScript', Line 62 16:25:13.215 - Stack End 16:25:14.150 - Disconnect from 127.0.0.1|52506 help plzzzzzzzzzz

3 comments
Why is there a return at the beginning that just ends the function and returns an empty function
testing...
IT WOOOOORRRRKKKKKKKSSSS!!!!!!!!!