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

Other Auras dosen't give you the aura?

Asked by 4 years ago
Edited 4 years ago

NOTE: People, this is not a short question. It doesn't make sense but is a problem.

I'm making a game that has a shop which you can buy auras, the blue aura works but the red and white auras don't give you what they are supposed to do. Instead they give out this:

RedEffect (or WhiteEffect) is not a valid member of Part

I copypasted the blue aura script as it works, on these auras and replaced them to their respective colors. But they still don't do what i wanted them to do. So how does this happen?

Here's the script that handles the aura purchasing in ServerScriptService:

local auraEventBlue = game.ReplicatedStorage.AuraEventBlue
local auraEventRed = game.ReplicatedStorage.AuraEventRed
local auraEventWhite = game.ReplicatedStorage.AuraEventWhite

if auraEventBlue.OnServerEvent:Connect(function(player,char) 
    script.BlueEffect:Clone().Parent = char.HumanoidRootPart
    end) then
elseif auraEventRed.OnServerEvent:Connect(function(player,char)
    script.RedEffect:Clone().Parent = char.HumanoidRootPart
    end) then
elseif auraEventWhite.OnServerEvent:Connect(function(player,char)
    script.WhiteEffect:Clone().Parent = char.HumanoidRootPart
end) then
end

Here's the aura script i use to do aura purchasing (for example the color is red):

local player = game.Players.LocalPlayer or game.Players.Players.PlayerAdded:wait()
local char = player.character or player.Character or player.CharacterAdded:Wait()
local auraEventRed = game.ReplicatedStorage.AuraEventRed
local variable = false
local PurchaseMeter = true

script.Parent.MouseButton1Down:Connect(function()
    for i,v in pairs(game.Players:GetPlayers()) do
        if v:FindFirstChild("leaderstats") then
    if v.leaderstats.Credits.Value >= 50 then
        if PurchaseMeter == true then
        v.leaderstats.Credits.Value = v.leaderstats.Credits.Value - 50
        PurchaseMeter = false
     end

 if not variable then
  variable = true
  auraEventRed:FireServer(char)
  script.Parent.Text = "Disable Red Aura"
 else
  variable = false
  char.HumanoidRootPart.RedEffect:Destroy()
  script.Parent.Text = "Enable Red Aura"
 end
end
end
end
end)

I will thank anyone for them to fix my scripts, have a good day!

0
The error says it all. RedEffect is not there in your game where you defined it. Uzixt 19 — 4y
0
oh really? can you explain further DecalMaker2468 21 — 4y
0
also the aura handler in serverscriptservice has the effects inside DecalMaker2468 21 — 4y

2 answers

Log in to vote
0
Answered by
crueluu 169
4 years ago

Remove All If Statments And "else if"'s From The First Script

Ad
Log in to vote
0
Answered by 4 years ago

people if you have the same problem as me remove the if and elseif statements from the first script

Answer this question