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

Why isn't my script for an aura not working in the server but it's working in Studio?

Asked by 6 years ago
Edited 6 years ago

The title says it all.

Here's the code;

plr = script.Parent.Parent
UIS = game:GetService("UserInputService")
Aura = game.ServerStorage:WaitForChild("ChronosAura")
obool = true
if script.Parent.Parent.Name == "Player1" then
    print("He's here.. giving aura to Chronos/Waiting for on key")
    UIS.InputBegan:connect(function(Input,gameProcessed)
        if Input.KeyCode == Enum.KeyCode.Q then
            if obool == true then
            print("AURA LOADING IN!!")
            wait()
            if plr.Character.Head:FindFirstChild("Lightning") then
                                wait()
            plr.Character.Head.Lightning.Enabled = true
            plr.Character["Left Arm"].Lightning.Enabled = true
            plr.Character["Right Arm"].Lightning.Enabled = true
            plr.Character["Left Leg"].Lightning.Enabled = true
            plr.Character["Right Leg"].Lightning.Enabled = true
            plr.Character.Torso.Lightning.Enabled = true
            else
                print("doesnt have aura")       
                                Aura.Head.Lightning.Parent = plr.Character.Head
            Aura["Left Arm"].Lightning.Parent = plr.Character["Left Arm"]
            Aura["Right Arm"].Lightning.Parent = plr.Character["Right Arm"]
            Aura["Left Leg"].Lightning.Parent = plr.Character["Left Leg"]
            Aura["Right Leg"].Lightning.Parent = plr.Character["Right Leg"]
            Aura.Torso.Lightning.Parent = plr.Character.Torso

            end

            bool = true
            obool = false
            end
        else

        end
    end)
    UIS.InputBegan:connect(function(input,gameProcessed)
        if input.KeyCode == Enum.KeyCode.Q then
            if bool == true then
                print("aura closing")
                wait()
            plr.Character.Head.Lightning.Enabled = false
            plr.Character["Left Arm"].Lightning.Enabled = false
            plr.Character["Right Arm"].Lightning.Enabled = false
            plr.Character["Left Leg"].Lightning.Enabled = false
            plr.Character["Right Leg"].Lightning.Enabled = false
            plr.Character.Torso.Lightning.Enabled = false
                obool = true
                bool = false
            end
        end
    end)
end

That code is getting particles from a model called 'ChronosAura' in ServerStorage and when i play in server it says chronosaura is not a valid member of serverstorage..

This code is located in a LocalScript in StarterPack and the game is not filtering enabled.

If you need anymore details ask

0
Ok thank's I will try that. Ind1v1duals 43 — 6y
0
Thanks a lot it worked, i learned from this and it will help me a lot in the future.. if you want credit for your help post an answer Ind1v1duals 43 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

First of all, I would recommend switching your games to filtering enabled. This is useful for exploit prevention and it can make your game more organized. You can convert scripts to filtering enabled with RemoteEvents. If you don't want particles to get in the way of other players, you can also just make them client side by moving your 'ChronosAura' object to ReplicatedStorage. If filtering is disabled in your game, I would make sure you have the correct spelling when you refer to objects. It is case sensitive, so if a character is wrong it will break your script. Good luck with your game!

Ad

Answer this question