#PLS HELP

150 messages · Page 1 of 1 (latest)

uncut shard
#

so thats the leaderstats script

austere crown
#

Somethings more?

uncut shard
#

thats the giver

#

it doesnt work

#

it tells me

austere crown
#

StarCoins.Value = 0

GoldenCoins.Value = 0

uncut shard
#

there is nothing such as leaderstats in the part

austere crown
#

do that in leaderstats

uncut shard
#

nah

#

ik

austere crown
#

ik

#

lol

#

well then do like this

uncut shard
#

but thats not the problem

austere crown
#

uhhh

#

u know

uncut shard
#

I understant the problem

austere crown
#

touched doesnt got player as argument

uncut shard
#

but idk how to fix

uncut shard
austere crown
#

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

uncut shard
#

ty

#

it does work

#

but now there is another problem

austere crown
#

?

uncut shard
#

so I have another script in the part

austere crown
#

yup

uncut shard
#

that does that if its touched

#

it disappear

#

the coin

#

but it only make it transparency 10

#

1

#

so i can still touch it

austere crown
#

can u send the script?

uncut shard
#

ok

austere crown
#

ill modify and explain to you

uncut shard
austere crown
#

uh

#

like copy and paste

uncut shard
#

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

austere crown
#
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

uncut shard
#

still detects

#

but ty for help

austere crown
#

Well thats what im saying, u would do that in the coin gain script.

#

That only affects to this script

uncut shard
#

oh

#

so I delete the script

austere crown
#

Nah, leave it like as it was

#

Like when u copy and pasted, and send the coin gain script if u want to

uncut shard
#

I deleted all so I need to remake

#

Ima chat when I finish remake

austere crown
#

Alright, if u have any problems tell me right here

uncut shard
#

ok

silent timber
#

hi

uncut shard
#

still dont work

uncut shard
austere crown
#

would i see the script

uncut shard
#

I wanna know if i get it right

austere crown
#

copy and paste

uncut shard
#

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

austere crown
#
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

uncut shard
#

its worse

austere crown
#

what

uncut shard
#

it dont give me even 1

austere crown
#

ohh

#

forgot

#

to connect the func

uncut shard
#

oh ok

#

ima do it

austere crown
#

script.Parent.Touched:Connect(onTouched)

#

write that at the end

uncut shard
#

ok

#

ty works perfectly fine

austere crown
#

Can i recommend u a thing

#

As i see this is a coin script and in the game would be a lot of coins (?)

uncut shard
#

not a lot

#

like 100 max

#

I think

austere crown
#

Yes a lot

uncut shard
#

Ima ask my friend

#

ok

austere crown
#

In that case i would use a modulescript

uncut shard
#

ima do it later

#

because I still didnt learn module script

#

I finished learnign Tools

austere crown
#

with modulescript you can edit easier the gain, delay and that things but it may be too complex

uncut shard
#

ye ima learn it after

austere crown
#

if you can learn modulescripts learn it because its like one of the most important things on roblox studio

#

so gl

#

see ya

uncut shard
#

ok

#

ty

#

have a nice day

#

but when I do it to the second coin theres a problem in the connect

austere crown
#

Tell me

uncut shard
#

it doesnt identify OnTouch

austere crown
#

would i see the full script? seems like something messed up

#

in photo

uncut shard
#

thats the part of touched

austere crown
#

Make sure you copy and pasted it good

uncut shard
#

i didnt

#

I just did Ctrl + D

#

to the script

austere crown
#

what

#

can i see the full script like all

uncut shard
#
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

austere crown
#

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)
sick herald
#

I don’t think you’re supposed to provide scripts for them

austere crown
#

As i provide i explain too.

uncut shard
#

ye

austere crown
#

If someone don't wanna understand what im doing it's her problem

uncut shard
#

I can proof

#

I can make the exact same leaderstats as the ui I made

#

to show I understood

sick herald
#

You’re still providing scripts

austere crown
#

I'm not providing scripts, as I just fix it and then explain, so please don't complain.

uncut shard
#

bro is helping everyone in the channel

uncut shard
#

pls

warm gorge
#

im here to help you

#

so what is ur main problem?