#[NewScripter] How do i make it so when i click my Gui "Restart" it fires the function "DiceRoller"
42 messages · Page 1 of 1 (latest)
Well this are 2 different runservices (server and client). The easiest way to send a signal from client to server is by using remote events
where do i put the remote event
Somewhere in replicatedstorage
ok
so what do i do
i got the remote event but idk how to make it do anything
Have client fire them and connect OnClientEvent to the DiceRoll function on server
Basically declare the remote in both scripts
Then have Remote:FireServer() on the local script
Then Remote.OnClientEvent:Connect(DiceRoller) on server
so the first part client fire them i put it in the local script
This will be in the local script
This in the server script
Server = white, local = blue
remote is game.ReplicatedStorage.RemoteEvent ?
so i make a variable ??
Yes
ok
but the diceroller is still unknow in the local script
It doesn’t have to be known in that script
You fire the remote event. Then the server will just check for a signal from the remote event and then fire the function in itself
like this ?
it saying that onclientevent can only be used on the client
also the variables maingui and restart i have deleted because it wa causing bugs
OnServerEvent, sorry
switching it to onserverevent doesnt make it go back to its position
i think it because i need to add that onto my script tho
Oh, I taught you just wanted them to reroll
If you want them to reset then you’ll need to save the starting orientations in a variable
can i just add the position in the diceroller function ?
i cant
oh wait
i meant the position, but the oriantation needs to be random
also the event fires by itself without me clicking any buttons
** You are now Level 4! **