EDIT: It returned a error this time:
22:12:31.452 - ServerScriptService.FormServerside.Adrenaline:5: attempt to index number > with 'Character' 22:12:31.453 - Stack Begin 22:12:31.454 - Script 'ServerScriptService.FormServerside.Adrenaline', Line 5
I am working on an RPG game with my development team, and being the only scripter I have to write all of our code. This is a very rushed Form for the Race Human.
The race operates by having a set boost value and a keypress to launch an event to create an aura. I am going to add the boost code later, but this code simply does not work.
This is the code for the LocalScript in StarterPack:
repeat wait() until game.Loaded
local mouse = game.Players.LocalPlayer:GetMouse()
local Race = script.Race.Value
local Boost = script.Boost.Value
local Player = game.Players.LocalPlayer
function onKeyDown(key)
if (key~=nil) then
key = key:lower()
if (key=="f") then
if Player.Backpack.ServerTraits.Race.Value == script.Race.Value then
game.ReplicatedStorage.FormEvents.FormEvent:FireServer(Race, Boost, Player)
else
return false
end
end
end
end
mouse.KeyDown:connect(onKeyDown)
This is the code for the Script in ServerScriptService:
game.ReplicatedStorage.FormEvents.FormEvent.OnServerEvent:Connect(function(Race, Boost, Player)
print(Race)
print(Boost)
print(Player)
local Character = workspace:FindFirstChild(Player.Name)
if Character.UpperTorso.Aura then
return false
else
local Aura = Instance.new("ParticleEmitter")
Aura.Parent = Character.UpperTorso
Aura.Name = "Aura"
Aura.Color = Color3.fromRGB(170,0,0)
Aura.Size = 10
Aura.Texture = 'https://www.roblox.com/library/347913778/ssj-aura'
Aura.Transparency = .95
Aura.LockedToPart = true
Aura.Lifetime = 0.2
Aura.Rate = 31
end
end)
It all works until it reaches the Character portion, can anybody help?
