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

Why my localscript doesnt do anything? All of this is located in the right place

Asked by 2 years ago
script.Parent.Triggered:Connect(function(Player)
    print("fire?")
    local event = game.ReplicatedStorage:WaitForChild("PressedEvent")
    event:FireClient(Player)
    print("fired lol")
end)

This is in the workspace This prints all of the things I put (This is a normal script)

game.ReplicatedStorage.PressedEvent.OnClientEvent:Connect(function()
    local config = require(script.Parent.Parent.Parent.Parent.Config)
    local passed = true
    print(2)
    local Player = game.Players.LocalPlayer
    local function checkRank()
        print(3)
        local rankId = Player:GetRankInGroup(config.GroupId)
        if rankId < config.MinimuimRank then
            passed = false
        end
    end
    if not config.MinimuimRank == 0 or config.GroupId == 0 then
        print(3.5)
        checkRank()
    end
    if passed == true then
        print(4)
        script.Parent.Parent.Parent.Parent.Guis.StartGUI:Clone().Parent = Player.PlayerGui
    end
end)

This doesn't print anything and doesn't do anything This is located in workspace

This is local script

1
LocalScripts don't run in workspace unless in a Player's Character Spjureeedd 385 — 2y
0
You should consider reading up when working with things you are unfamiliar with: https://developer.roblox.com/en-us/api-reference/class/LocalScript Spjureeedd 385 — 2y

Answer this question