I've recently been dabbling in coding and tried to make your generic power-up script. However, whenever I run the game I get the feedback "Duration is not a valid member of part." If I delete the duration line, It just says "Jump is not a valid member of part." How would I attempt to fix this? (This problem has also cropped up in many of my other scripts as well.)
local PowerUp = script.Parent
local duration = PowerUp.Duration.Value
local speedamount = PowerUp.Speed.Value
local jumpamount = PowerUp.Jump.Value
local CanTouch = true
local function GivePower(part)
local hum = part.Parent:FindFirstChild("Humanoid")
if hum and CanTouch then
CanTouch = false
local originalspeed = hum.WalkSpeed
local originaljump = hum.JumpPower
hum.WalkSpeed = speedamount
hum.JumpPower = jumpamount
PowerUp.Transparency = 1.0
wait(duration)
PowerUp.Transparency = 0.0
hum.WalkSpeed = originalspeed
hum.JumpPower = originaljump
CanTouch = true
end
end
Any help would be greatly appreciated!

2 comments
Double check if the Duration is in the parent of the script. Also, did u add these Int/Number values by default or using a script?
I added them by default. They are in the part that the script is inside. Should I put the values inside the script?