#Trying to send message from server to player.

246 messages · Page 1 of 1 (latest)

potent viper
#

use warn?

#

or a gui pop up

#

would be nice

waxen meteor
#

How do I link this and a gui pop up?

#

This is running inside the door

hearty robin
#
if not lockpick then
  local tempSG = Instance.new("ScreenGUI") 
  tempSG.Parent = player.PlayerGui

  local warning = Instance.new("TextLabel")
  warning.Visible = false
  warning.Parent = tempSG
  --customize label
  warning.Text = "no lockpick"
  warning.Visible = true
  
  task.wait(delay)
  
  warning:Destroy()
  tempSG:Destory()
end
#

very washed up

#

but that should work

#

i recommend adding a debounce btw

#

depending on if you have other local handlers it may be easier to use a rem event

waxen meteor
#

will give it a try

#

I am getting player is an unknown global

hearty robin
#

oh

waxen meteor
#

what should I define player as

hearty robin
#

you have to replace those

hearty robin
#

that the warning is going to display on

#

it would be in

#

game.Players.{insert player}

#

also

#

i think some of the capitalization is incorrect

#

on my draft

#

:p

waxen meteor
#

I want it to do it for every player that trys to lockpick the door without a lock pick not a single person

hearty robin
#

right so

#

is the script a localscript?

#

the one that handles the door click

waxen meteor
#

Nope

hearty robin
#

ok good

waxen meteor
#

It is just script

hearty robin
#

can i see it

waxen meteor
#
function onClicked(parent)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
            if not lockpick then
                local player = playerId
                local tempSG = Instance.new("ScreenGUI") 
                tempSG.Parent = player.PlayerGui

                local warning = Instance.new("TextLabel")
                warning.Visible = false
                warning.Parent = tempSG
                --customize label
                warning.Text = "no lockpick"
                warning.Visible = true

                task.wait(delay)

                warning:Destroy()
                tempSG:Destory()
            end
            return
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick?"
        prompt.ActionText = "Locked"
    end
end


script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
hearty robin
#

one sec

waxen meteor
#

all good take your time

hearty robin
#

there are 2 "if not lockpicks"s

waxen meteor
#

oh woops

#

there we go

hearty robin
#

can you send the new one

#

discord is being weird with the indents

waxen meteor
#
function onClicked(parent)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
                local player = playerId
                local tempSG = Instance.new("ScreenGUI") 
                tempSG.Parent = player.PlayerGui

                local warning = Instance.new("TextLabel")
                warning.Visible = false
                warning.Parent = tempSG
                --customize label
                warning.Text = "no lockpick"
                warning.Visible = true

                task.wait(delay)

                warning:Destroy()
                tempSG:Destory()
            end
            return
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick?"
        prompt.ActionText = "Locked"
    end



script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
hearty robin
#

thx

waxen meteor
#

if you want it without the code you gave me here is this

#
function onClicked(parent)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
            -- TODO: Show error to user
            return
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick?"
        prompt.ActionText = "Locked"
    end
end

script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
hearty robin
#

oh ty thats better

plain plaza
#

Fire a remote event pick it up from a local script then have data tables that get sent then change the gui text or wherever to what the data is that you sent

hearty robin
#

hmm its been a while since i used prox prompts 💀

#

do you know if i can get the triggering player

plain plaza
#

Wdym?

hearty robin
#

like

#

.Triggered:Connect(player)

#

does that return the player

#

who clicked

plain plaza
#

Yea

#

Not clicks

#

Just proximity prompts

hearty robin
#

oh ok

#
function onClicked(parent, player)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
        local tempSG = Instance.new("ScreenGUI") 
          tempSG.Parent = player.PlayerGui

          local warning = Instance.new("TextLabel")
          warning.Visible = false
          warning.Parent = tempSG
          --customize label
          warning.Text = "no lockpick"
          warning.Visible = true
  
          task.wait(delay)
  
          warning:Destroy()
          tempSG:Destory()
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick?"
        prompt.ActionText = "Locked"
    end
end



script.Parent.ProximityPrompt.Triggered:Connect(function(player)
    onClicked(nil, player)
end)
#

that should work

#

oops

#

nvm fixed it

hearty robin
#

💀

waxen meteor
#

Workspace.Lockpickable Door.Doorframe.Lock.Door:34: attempt to index nil with 'Character' - Server - Door:34

#

oh you removed return

hearty robin
#

um

#

oh

#

yeah

#

was that important?

waxen meteor
#

Yea it prevents error

hearty robin
#

i didnt see what that returned

hearty robin
#

but the code still wont work

#

right

waxen meteor
#

The og code works with return

hearty robin
#

oh ok

waxen meteor
#

The code that you gave me is not giving me a prompt

hearty robin
#

idk..

#

wdym

waxen meteor
#

It is not doing anything

#

I am not getting warning text

hearty robin
#

OH

#

oops

#

forgot

#

i didnt know what the "parent" was for

#

so

#

when it runs the function

#

it gives parent nil

#

second last line

#

you should do something with that?

#

i dont understand what you need the parent for

waxen meteor
#

The parent in onClicked function?

hearty robin
#

yes

#

what is it for?

waxen meteor
#

that allows it to find the lockpick in the player

hearty robin
#

OH

waxen meteor
#

because when you hold an item it gets moved out of backpacck

#

into player

hearty robin
#

you should have said that earlier -_-

#

so

#

parent

#

is the player?

#

in game.players

waxen meteor
#

let me check

#

uhhh where do I double check to see that?

clear cairnBOT
#

studio** You are now Level 3! **studio

hearty robin
#

uh

#

idk?

#

lol

#

but

#

that makes things easier

#

one sec

#

lemme change it

waxen meteor
#

ok

hearty robin
#
function onClicked(parent)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
        local tempSG = Instance.new("ScreenGUI") 
          tempSG.Parent = parent.PlayerGui

          local warning = Instance.new("TextLabel")
          warning.Visible = false
          warning.Parent = tempSG
          --customize label
          warning.Text = "no lockpick"
          warning.Visible = true
  
          task.wait(delay)
  
          warning:Destroy()
          tempSG:Destory()
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick?"
        prompt.ActionText = "Locked"
    end
end



script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
#

try that

waxen meteor
#

Unable to create an Instance of type "ScreenGUI"

hearty robin
#

right

#

so

#

capitalization was off

#

it might be

#

ScreenGui

waxen meteor
#

Workspace.Lockpickable Door.Doorframe.Lock.Door:47: invalid argument #1 to 'wait' (number expected, got function)

hearty robin
#

what

#

where?

waxen meteor
#

That is the error I got

#

line 47

hearty robin
#

which line is that?

#

sorry id rather not count

waxen meteor
#

task.wait(delay)

hearty robin
#

OH

#

yeah

#

you can insert the delay you want

#

for it to disappear

#

wtvr u want

#

did it work tho?

waxen meteor
#

nope

#

No errors

#

Just nothing

hearty robin
#

did you get the "bruh"

waxen meteor
#

bruh is only when you use the lockpick'

hearty robin
#

oh

waxen meteor
#

if i add print right before delay

hearty robin
#

OH whoops

#

did you customize it?

#

you have to specify position and size and everythin

#

g

plain plaza
waxen meteor
#

When the players attempts to open the door without a lockpick i want a gui message to apear saying You need a lockpick to pick this lock. Then I want it to fade away

hearty robin
waxen meteor
#

all good

hearty robin
#

👋

waxen meteor
#

See ya

#
function onClicked(parent)
    if active == true then
        local lockpick = parent.Character:FindFirstChild('Lockpick')
        if not lockpick then
            -- TODO: Show error to user
            return
        end
        
        active = false
        tweenOpen:Play()
        script.Parent.Unlock:Play()
        print('bruh')
        prompt.ObjectText = "Door"
        prompt.ActionText = "Unlocked!"
        wait(5)
        tweenClose:Play()
        active = true
        prompt.ObjectText = "Lockpick Required"
        prompt.ActionText = "Locked"
    end
end

script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
#

Og code

waxen meteor
#

Forgot to reply to that

waxen meteor
#

Yea that is what I am trying to do

plain plaza
waxen meteor
#

checked em you said nvm about the script?

#

oh about needing it my b

onyx shadow
#

Is this solved

#

@waxen meteor

plain plaza
#

Yes

onyx shadow
#

Not talking to u

plain plaza
#

We solved it in Dms

onyx shadow
#

I'm talking to guy called ingunner

plain plaza
onyx shadow
#

And?

#

Not talking to u.

plain plaza
#

It’s fixed and works

onyx shadow
#

I'm talking to seperate man by diffirent user

#

And a non twitter kid

#

@waxen meteor any other issues if not please mark as solved.

plain plaza
onyx shadow
#

Don't talk then

#

Kindly Ur not part conversation I'm engaging on

#

So you would be doing me favour

plain plaza
#

Well I’m just trying to not waste your time by telling you it’s solved

onyx shadow
#

I'm asking any other issues 2nd

#

It's not wasting my time

#

It's 1am

plain plaza
#

8 pm for me lol you should go to bed

onyx shadow
#

Being unproductive sleeping early

#

Leads to less developed mind

#

When you can be debugging, making databases, doing commissions, doing cyber sec, learning assembly to reverse engineer why waste Ur time sleeping

plain plaza
#

Ok Mr everything on the internet is true kid lol

onyx shadow
#

I'm kid wouldn't be sure about that.

#

Wouldn't be sure at all if I was you.

#

Way older than some kid that's for sure

#

And I got expiernce in life considering I grew up in poor area

plain plaza
#

Ok lmao I don’t need your life story

onyx shadow
#

Yeah and I don't need you talking still

#

You said you was gonna like ignore me bit back

#

I'm still waiting for that.

plain plaza
#

Well you don’t need to bug tf out of him which I am sure you where going to do.

onyx shadow
#

But?

#

Buy*

#

Man thinks I'm salesman now

#

He asked for help I assist

plain plaza
#

Bug*

plain plaza
onyx shadow
#

Now sit down in Ur 200lbs chair support.

#

Refrain from typing to much you may burn phew calories

#

Now please refrain from typing sqeaky boy.

#

Now I shall join vc and harrass my irl friends while they play the forest and try to replicate sky bases in the forest

plain plaza
onyx shadow
#

No I heard u

#

Ur voice lit up

#

Your sqeaker. Presuming ima child

plain plaza
#

Naw mic broken or something want be to record a vid for proof?

onyx shadow
#

Uhu sure bucko lmfaooo

#

Man's in denial he's sqeaker

#

Grow tf up bro

#

Also how this mf get all his Roblox vids age restricted

#

Tf man's do on video

plain plaza
plain plaza
onyx shadow
#

OMFG

#

Ur like 14 PAHAH

#

Man's still child

plain plaza
#

And?

onyx shadow
#

I can hear still sqeak in Ur voice

#

Calling me child

plain plaza
#

When did I call you a child?

onyx shadow
#

Just cause my profile picture is anime

#

To blend in with you people

#

So discord doesn't ban me again

plain plaza
#

I could care less what your pfp is

onyx shadow
#

Y'all presuming I'm a kid

#

@plain plaza you mean I couldn't.

plain plaza
#

No

#

Banned for being a 40 yo pred?

onyx shadow
#

What

#

I mean don't get me wrong discord banned me 41 times but I sure ain't no ped

#

I counted all bans quite phew

plain plaza
#

What did you get banned for?

onyx shadow
#

Discrimination, malicious hacking, self bots bunch other stuff

#

Just multiplied phew times

#

Discrimination like 7x times

#

Including servers I was in what got banned for it

plain plaza
#

Makes sense

onyx shadow
#

Discord mods are furries they class anything slightly wrong against there kind

#

As discrimination

waxen meteor
#

It is solved

gilded valley
#

lmao wtf y'all get so heated over