#Code being kind of finnicky

1 messages · Page 1 of 1 (latest)

latent pine
#

I'm trying to make a dialogue system involving communication between scripts, but the values are inconsistent between them.

#

proximityprompt code (server script)

#

startergui code (local script)

cursive pendant
latent pine
#

the caninteract variable is used for some other scripts

cursive pendant
latent pine
#

and the function is called when it's over

cursive pendant
#

alrighty i think i have a better idea of what you're doing..? and i wanted to ask, if 'activator' is the player then you might be able to just access your folder through that insead of through Players and player.name, which is what I did in my recreation;

prox.Triggered:Connect(function(activator)
    -- for me, activatoris the player, and I was able to access my folder like:
    local MyFolder = actv:WaitForChild("Folder")
    -- then my bool object
    local isInteracting = MyFolder:WaitForChild("InteractingBool").Value
    -- i just did the bool value for my example btw lol..
    if not isInteracting then -- aka , if interacting is false then...
        isInteracting = true -- now, we are marked as interacting (true)
        -- now the remote event cant be fired unless it's changed back to false!
        
        print("Interacting =",isInteracting,
            "----------------------------"
        )
        
        startDialogueRE:FireClient(activator)
    end
    
end)

(i tried to replicate the code to understand, sorry if my questions seemed silly)

#

i dont think that has anything to do with your issue though 🫠

#

im still looking

#

oh right are you trying to change the bool & string values via local script when the dialogue has finished? this only changes that on the local side, so when you detect on the server side it has not changed for the server, when the dialogue finishes, use a server sided script to update your values

#

local and server side can be confusing

latent pine
solemn timberBOT
#

studio** You are now Level 12! **studio

cursive pendant
#

i named this block "super cool block" [first image, server side]
then when triggering a local script it will rename it to "super lame block" [second image, my local side]
on the server, it will still be super cool block, but for me its lame, local scripts will see it as lame, and server scripts will see it as cool

cursive pendant
#

i had that example backwards.. but yeah

latent pine
#

EndDialogue:FireServer(player)

#

?

cursive pendant
#

pretty sure, yes 🤔 if the endDialogue is a local script then you can get the player the basic ol' game.Players.LocalPlayer way

#

you can pass any value you want really in remote events, rather is be string, bool, wtv

latent pine
#

thanks!