Hey!
I have a script (by alaaeiou). The script is supposed to give a player x2 stats (Time) when they step on a part and if they step off they only gain x1 but, it won’t work.
There is a script parented to a brick in the workspace:
Inside the script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local character = hit.Parent
local multiplier = Instance.new("IntValue",character)
multiplier.Name = "Multiplier"
multiplier.Value = 10
end
end)
script.Parent.TouchEnded:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local character = hit.Parent
character.Multiplier.Value = 1
end
end)
There is a separate script in StarterPlayer>StarterCharacterScripts that is in charge of adding stats.
local multiplier = character:WaitForChild("Multiplier")
while not hasDied and not CheckSpawnRegion() do
timeAlive.Value += multiplier.Value
^There’s variables and more the script but, I did not include it since its big and messy.
Example of what am trying to achieve:
Help is really, really appreciated.