Brick = script.Parent Sound = Brick.Sound
function onClicked() Sound:Play() game.StarterGui.ScreenGui.Frame.Visible = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Brick = script.Parent Sound = Brick.Sound
function onClicked() Sound:Play() game.StarterGui.ScreenGui.Frame.Visible = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
You changed the StarterGui Guis. StarterGui guis are only viewable by server and what we see is PlayerGui. Heres a sample below:
game.Players.Thelodomir_320.PlayerGui.ScreenGui.Frame.Visible = true
To fit in your script, you need to access to PlayerGui. By accessing PlayerGui you need to have the player. You can get player parameter with PlayerAdded event. You can access it with any script.
game:GetService("Players").PlayerAdded:Connect(function(player) -- to get the player parameter
local Brick = script.Parent
local Sound = Brick.Sound
function onClicked()
Sound:Play()
player:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = true
end
Brick.ClickDetector.MouseClick:Connect(onClicked)
end)
Hm. Well I say i have the solution for that.
You did the sound and the playing sound wrong.
Brick = script.Parent.Brick.Sound
local function OnClick()
Brick.Playing = true
game.StarterGui.ScreenGui.Frame.Visible = true
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
not
Brick = script.Parent Sound = Brick.Sound
function onClicked()
Sound:Play() game.StarterGui.ScreenGui.Frame.Visible = true
game.StarterGui.ScreenGui.Frame.Visible = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
ooooh