#[NEW PROBLEM] Ui problem

1 messages · Page 1 of 1 (latest)

terse tartan
#

server script

local event = game.ReplicatedStorage.BoughtEvent
event.OnServerEvent:Connect(function(args)
    local product = args[1]
    print(args[1])
end)
#

local script

local boughtevent = game.ReplicatedStorage:WaitForChild("BoughtEvent")
script.Parent.MouseButton1Down:Connect(function()
    local args = {"NVGoggles"}
    boughtevent:FireServer(args)
end)
tawdry tendon
#

the onserver event always has a player agrument

#

so it should be

terse tartan
#

so i gotta do what

tawdry tendon
#
local event = game.ReplicatedStorage.BoughtEvent
event.OnServerEvent:Connect(function(plr, args)
    local product = args[1]
    print(args[1])
end)
terse tartan
#

thanks

terse tartan
#

[NEW PROBLEM] Ui problem

#

---------------------UI PROBLEM-------------------

#

script 1 (proximity prompt)

local proximityPrompt = script.Parent
local remoteevent = game.ReplicatedStorage.ShopEvent

proximityPrompt.Triggered:Connect(function(player)
    remoteevent:FireClient(player)
end)
#

script 2(exit script in ui)

script.Parent.MouseButton1Down:Connect(function()
    local player = game.Players.LocalPlayer
    local ui = script.Parent.Parent:GetDescendants()

    for _, v in pairs(ui) do
        if v:IsA("Frame") or v:IsA("TextLabel") or v:IsA("TextButton") or v:IsA("ImageButton") or v:IsA("ImageLabel") or v:IsA("ScrollingFrame") then
            v.Visible = false
        end
    end

local humanoid = player.Character:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.WalkSpeed = 16
    end
end)
#

script 3 (remote ui handler)

local player = game.Players.LocalPlayer
local shopUI = player:WaitForChild("PlayerGui"):WaitForChild("shopui")

player.CharacterAdded:Connect(function()
    for _, v in pairs(shopUI:GetDescendants()) do
        if v:IsA("Frame") or v:IsA("TextLabel") or v:IsA("TextButton") or v:IsA("ImageButton") or v:IsA("ImageLabel") or v:IsA("ScrollingFrame") then
            v.Visible = false
        end
    end
end)

game.ReplicatedStorage.ShopEvent.OnClientEvent:Connect(function()
    for _, v in pairs(shopUI:GetDescendants()) do
        if v:IsA("Frame") or v:IsA("TextLabel") or v:IsA("TextButton") or v:IsA("ImageButton") or v:IsA("ImageLabel") or v:IsA("ScrollingFrame") then
            v.Visible = true
        end
    end

    local humanoid = player.Character:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.WalkSpeed = 0
    end
end)