As you can see for me, my stats show but his doesn’t and for him his stats shows but doesn’t for me. Another issue is that the heads that get cloned don’t show on any screen except the player controlling the character. What is happening?
2 scripts for cloning heads and selling are in StarterCharacterScripts and are local scripts.
Selling: (The leaderstats script is in ServerScriptService it’s just this one sell script that’s in a local script)
local player = game.Players.LocalPlayer
local plr = player.Character
local folder = plr:FindFirstChild("headContainer")
local function sell()
player.leaderstats.Money.Value = --converting rate here
player.leaderstats.Heads.Value = -- just taking away values
end
part.Touched:Connect(sell)
Clone Script:
UserInputService.InputBegan:Connect(function(input)
local leaderstats = plr:WaitForChild("leaderstats")
local h = leaderstats:WaitForChild("Heads")
local e = plr:WaitForChild("mf")
local m = e:WaitForChild("headMultiplier")
local function clicked()
h.Value += 1 * m.Value
local cloned = head:Clone()
cloned.Parent = headFolder
cloned.Position = head.Position + Vector3.new(0, 1*h.Value, 0)
end
-- there is a part after this that uses clicked()
end)
(Some parts are missing as they are not as important)
I recommend making it a server script since local scripts run things that only the client can see…
Also, use PlayerAdded This event will fire when a player joins the game. This can also be used to load the player’s saved data to the game.
Do I place this script in ServerScriptStorage or StarterCharacterScripts? When I modified my script and placed it in ServerScriptStorage, I wasn’t able to do things with the players head.
I know what you’re talking about but the problem is I don’t know exactly what you did on the script since you said you weren’t able to do things with the players head so let me modify the script and fix the players head problem you’re talking about