I’m currently writing a script that will allow a GUI to appear when the block is clicked, but I’m having some trouble. Basically, if they have the game pass the UI shows up, but if they don’t it doesn’t allow them to click causing the UI not to show up.
In the output it says
“expected’end’(to close’then’ at line 9), got ; did you forget to close ‘then’ at line 21”’
Here’s the script…
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
local Give = game:GetService("ReplicatedStorage").Events:WaitForChild("Give")
local marketplace = game:GetService("MarketplaceService")
local gamepassid = script:WaitForChild("Gamepass ID").Value
local GamepassID = 10574037
game.Players.PlayerAdded:Connect(function(player)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserID, GamepassID) then
Mouse.Button1Down:connect(function()
if Mouse.Target == nil then return end
if Mouse.Target.Parent.Name == "PremiumIsland" then
game.Players.LocalPlayer.PlayerGui.Fireplace.Frame.Visible = true
game.Players.LocalPlayer.PlayerGui.Fireplace.Frame:TweenPosition(UDim2.new(0.5,0,0.5,0), "Out", "Bounce", 1)
end
end)
Mouse.Button1Down:connect(function()
if Mouse.Target == nil then return end
if Mouse.Target:FindFirstChild("ClickDetector") then
Give:FireServer(Mouse.Target.Name)
end
end)