Hello , i have a game with placement script . But i created a conveyor with upgrades, if i click the button for upgrade when the conveyor is in Workspace , my gui open and i can buy it , but when the conveyor is in Replicated Storage and i place it in Workspace with my placement script , if i click the upgrade button, my gui don’t open.I have no errors in Output. This is the upgrade script :
local Players = game:GetService("Players")
local name = "speed for 0 ?" --name of upgrade
local cash = 0
Players.PlayerAdded:Connect(function(player)
script.Parent.ClickDetector.MouseClick:Connect(function(plr)-- if i click the button
player.PlayerGui:WaitForChild("Upgrades").Frame.Visible = true -- make the gui visible
script.Parent.BrickColor = BrickColor.new("Neon orange")-- make the button orange
player.PlayerGui:WaitForChild("Upgrades").Frame.TextLabel.Text = ("Are you sure to upgrade ".. name )--edit a text in gui
player.PlayerGui:WaitForChild("Upgrades").Frame.TextButton.MouseButton1Click:connect(function()--if i click the upgrade button in the gui
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - cash-- my money - the price
script.Parent.BrickColor = BrickColor.new("Bright green") --make the button green
script.Parent.Parent.Parent["Main Conveyor"].Velocity = script.Parent.Parent.Parent["Main Conveyor"].Velocity *2 --increase the conveyor velocity x 2
end)
end)
end)
