so i was making a changing value thing and the script didnt work (it didnt find the CSHOP folder inside of player), ill send some images
leaderstats:
script (in serverscriptservice):
i need help
so i was making a changing value thing and the script didnt work (it didnt find the CSHOP folder inside of player), ill send some images
leaderstats:
script (in serverscriptservice):
i need help
You cant use localplayer on the server. Delete the local player line
and then how can i get to the localplayer for changing value
The function gives you the player automatically
No like completely remove the local player line
You already had the player value there, why change it?
You can remove the local player = game.Players.LocalPlayer
as it is nil. There’s no local player on the server. OnServerEvent gives you the player that fired the event, and then all the arguments they passed.
and here?
The player is automatically given to you. You don’t need to define the player at all you can just do whatever with the player. If you don’t believe me print the player onto the console and you’ll see. TeleportService will still work.
sorry for my ignorance but this?
Print the player onto the console it should show you the player. I think the IntelliSense is weird right now
answer me!!!11111111111
I did ;-;
Did you print the player onto the console? And did it work?
yea the player name prints right
So when you test it, go to your player in the Workspace, not in the Players folder. This is player that you control in test mode.
Click on it in the Explorer window. See if you can find CSHOP somewhere in the player. If you cqan’t then you haven’t loaded CHSOP properly into the player.
everything works right, i got another question on a script
connected to this, i need to do another post or i say it directly here?
Good to hear its working
Letters,Letters,Letters
If it’s working now then mark whoever helped you solve it as the Solution.
If your new question is directly related to this one then just post it here so you don’t have to answer the same questions we’ve given you.
If it’s an entirely new question then make a new post.
see, the false/true value was for this: (check at the end of code)
-- LocalScript inside StarterPlayerScripts
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local function addTrail(part)
-- Create a new Trail instance
local trail = Instance.new("Trail")
-- Set properties of the trail
trail.Lifetime = 0.5 -- Time the trail lasts
trail.MinLength = 0 -- Minimum length of the trail
trail.MaxLength = 10 -- Maximum length of the trail
trail.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 255, 0)) -- Change color here
trail.Enabled = true
-- Parent the trail to the part
trail.Parent = part
-- Attach the trail to the part that will be moving
trail.Attachment0 = Instance.new("Attachment", part)
trail.Attachment1 = Instance.new("Attachment", part)
-- Position the attachments correctly
trail.Attachment0.Position = Vector3.new(0, 0, -1) -- Adjust as needed
trail.Attachment1.Position = Vector3.new(0, 0, 1) -- Adjust as needed
end
-- Add trail to the player's character parts
local function onCharacterAdded(char)
-- Wait for the character to fully load
local humanoidRootPart = char:WaitForChild("HumanoidRootPart")
-- Create a trail on the HumanoidRootPart
addTrail(humanoidRootPart)
end
-- Connect the character added event
player.CharacterAdded:Connect(onCharacterAdded)
-- If the character is already loaded, apply the trail immediately
if character and player.CSHOP.Trail.Value == true then
onCharacterAdded(character)
end
this is a localscript, however the “trail” does not show up and idk why
Does your AddTrail
function apply the trail? Maybe the trail has been added but it’s just the way you set it up makes it not show any visual effect. Check under the player’s HumanoidRootPart to see if the trail exists or not.