game:GetService("ReplicatedStorage").AwakeningEvent.OnServerEvent:Connect(function(plr, m) local WhiteandBlack = game.Lighting.GoblinHunt local SecondMode = game.Lighting.SecondPARTAFTERSOUND local Sword = game.StarterPack.GoblinSlayerSword local Player = script.Parent.Parent local me = Player wait() -----------------------------------------------------------------------On the Ground saying local Run = game:GetService("RunService") local animTrack = Player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.AwawkeningMode) animTrack:Play() WhiteandBlack.Enabled = true game:GetService("Chat"):Chat(Player.Character.Head, "love") wait(2.5) game:GetService("Chat"):Chat(Player.Character.Head, "Thats love") wait(2.5) game:GetService("Chat"):Chat(Player.Character.Head, "Everything Is love") -----------------------------------------------------------------------Starts getting clearer to see and he gets up inrage for i = 1, 4 do wait(0.5) WhiteandBlack.Saturation = WhiteandBlack.Saturation + 0.05 end game.Debris:AddItem(WhiteandBlack, 3) WhiteandBlack:Destroy() SecondMode.Enabled = true end)
How come the error says Character is not a valid member of DataModel?
You're indexing the player incorrectly.
local Player = script.Parent.Parent local me = Player
I'm assuming the script is somewhere where the second iteration of .Parent
leads to the Datamodel
(game
).
When you handle the OnServerEvent
signal from an event the player who fired the event is passed as the first argument of the connected function.
local myEvent = ... --// assumed reference to event local function onServerEventHandler(player, otherArguments) print(player, " fired the event with: ", otherArguments) end myEvent.OnServerEvent:Connect(onServerEventHandler)
You can get reference to the player who fired the event from the first argument. With reference to their player you can also get reference to their character. player.Character
local myEvent = ... --// assumed reference to event local animation = ... --// assuming reference to an animation instance local function onServerEventHandler(player, otherArguments) local character = player.Character local humanoid = character:WaitForChild("Humanoid") humanoid:LoadAnimation(animation):Play() end myEvent.OnServerEvent:Connect(onServerEventHandler)
You should accept this answer if it helped you