Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Other Auras dosen't give you the aura?

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!

3 comments

0

The error says it all. RedEffect is not there in your game where you defined it.

0

oh really? can you explain further

0

also the aura handler in serverscriptservice has the effects inside

2 answers

✓ Accepted answer

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.