#PLS HELP
150 messages · Page 1 of 1 (latest)
Somethings more?
StarCoins.Value = 0
GoldenCoins.Value = 0
there is nothing such as leaderstats in the part
do that in leaderstats
but thats not the problem
I understant the problem
touched doesnt got player as argument
but idk how to fix
oh
the argument of touched is the hitted part
so to get the player is
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
and in the argument of touched it would be hit
instead of player
?
so I have another script in the part
yup
that does that if its touched
it disappear
the coin
but it only make it transparency 10
1
so i can still touch it
can u send the script?
ok
ill modify and explain to you
oh
ok
local block = script.Parent
local disappearTime = 10
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(part)
if part.Parent:FindFirstChild("Humanoid") then
disappear()
wait(disappearTime)
appear()
end
end
block.Touched:Connect(onTouched)
my friend did it
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(part)
if part.Parent:FindFirstChild("Humanoid") then
if debounce then return end
debounce = true
disappear()
wait(disappearTime)
appear()
debounce = false
end
end
block.Touched:Connect(onTouched)
would be like that
between i think here is doesnt u want the debounce tho, as it only controls de appear/dissapear
if you wanna to control that you gain coins then u would do that in the coin gain script
Well thats what im saying, u would do that in the coin gain script.
That only affects to this script
Nah, leave it like as it was
Like when u copy and pasted, and send the coin gain script if u want to
Alright, if u have any problems tell me right here
ok
hi
still dont work
still dont work
would i see the script
I wanna know if i get it right
copy and paste
ok
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(part)
if part.Parent:FindFirstChild("Humanoid") then
if debounce then return end
debounce = true
disappear()
wait(disappearTime)
appear()
debounce = false
end
end
block.Touched:Connect(onTouched)
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local StarCoins = player.leaderstats.Star
StarCoins.Value = StarCoins.Value + 1
end)
thats the coin giver script
maybe I put the thing in wrong places
the script does add me something in value
but it spams
because it still detect the coin afetr disappear
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if debounce then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local StarCoins = player.leaderstats.Star
StarCoins.Value = StarCoins.Value + 1
debounce = true
disappear()
wait(disappearTime)
appear()
debounce = false
end
end
script.Parent.Touched:Connect(function(hit)
end)
This would work
You can just do it in a whole func cuz all is a Touched event
btw delete the last lines of script.parent.touched
lol
its worse
what
it dont give me even 1
Can i recommend u a thing
As i see this is a coin script and in the game would be a lot of coins (?)
Yes a lot
In that case i would use a modulescript
ima do it later
because I still didnt learn module script
I finished learnign Tools
with modulescript you can edit easier the gain, delay and that things but it may be too complex
ye ima learn it after
if you can learn modulescripts learn it because its like one of the most important things on roblox studio
so gl
see ya
ok
ty
have a nice day
but when I do it to the second coin theres a problem in the connect
Tell me
Make sure you copy and pasted it good
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(part)
if part.Parent:FindFirstChild("Humanoid") then
if debounce then return end
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if debounce then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local GoldenCoins = player.leaderstats.Golden
GoldenCoins.Value = GoldenCoins.Value + 1
debounce = true
disappear()
wait(disappearTime)
appear()
debounce = false
end
end
script.Parent.Touched:Connect(onTouched) ```
I cant show photo
look at the script
the ontouched func is two times declared
so
local block = script.Parent
local disappearTime = 10
local debounce = false
local function disappear()
block.Transparency = 1
block.CanCollide = false
end
local function appear()
block.Transparency = 0
block.CanCollide = true
end
local function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if debounce then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local StarCoins = player.leaderstats.Star
StarCoins.Value = StarCoins.Value + 1
debounce = true
disappear()
wait(disappearTime)
appear()
debounce = false
end
end
script.Parent.Touched:Connect(onTouched)
I don’t think you’re supposed to provide scripts for them
As i provide i explain too.
ye
If someone don't wanna understand what im doing it's her problem
I can proof
I can make the exact same leaderstats as the ui I made
to show I understood
You’re still providing scripts
I'm not providing scripts, as I just fix it and then explain, so please don't complain.
are you a mod or soemthing
bro is helping everyone in the channel
can you help em in something else rq
pls