Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Make Remote Events For A Tycoon's GUI?

Asked by 6 years ago

On Another Question I asked, someone Told Me (Who Was Really Helpful) To Use Remote Events But I'll Be Honest, I Have No Clues On How Does These Works... If Someone Could Help Me Figuring This Out Or Even Tools Or Tutorials That Could Help Would Be Really Appreciated :D

local main = script.Parent.Parent.Parent
local owner = main.Owner
local tn = main.Parent.TycoonName
local debounce = false

script.Parent.Touched:Connect(function(hit)
    if (debounce == false) then
        debounce = true
        local h = hit.Parent:FindFirstChild("Humanoid")
        if (h ~= nil) then
            local p = game.Players:FindFirstChild(hit.Parent.Name)
            if (p ~= nil) then
                if p.Tycoon.Value == true then
                    for GuiReveal = 1, 0, -0.05 do
                        p.PlayerGui.TycoonGui.Notice.Text = "You already have a "..tn.Value.."!"
                        p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.5, false)
                        p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
                        wait()
                    end
                    wait(3)
                    for GuiReveal = 0, 1, 0.15 do
                        p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(-1.2, 0, 0, 50), Out, Quad, 0.5, false)
                        p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
                        wait()
                    end
                    wait(2)
                    debounce = false
                return end
                owner.Value = p.Name
                p.Tycoon.Value = true
                for GuiReveal = 1, 0, -0.05 do
                    p.PlayerGui.TycoonGui.Notice.Text = "You now own a "..tn.Value..", "..p.Name.."!"
                    p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.5, false)
                    p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
                    wait()
                end
                main.Sign:remove()
                wait(3)
                for GuiReveal = 0, 1, 0.15 do
                    p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(-1.2, 0, 0, 50), Out, Quad, 0.5, false)
                    p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
                    wait()
                end
                for i = 0.4, 1, 0.02 do
                    wait()
                    script.Parent.Transparency = i
                end
                script.Parent.Parent:Destroy()
            end
        end
        wait(2)
        debounce = false
    end
end)

Thank You :)

0
:remove() is deprecated, and use :Destroy() User#19524 175 — 6y
0
Oops I Forgot To Change One, Thanks :) friendman7000 3 — 6y
0
Still Doesnt Works :/ friendman7000 3 — 6y

Answer this question