#need to get a script

35 messages · Page 1 of 1 (latest)

light tendon
#

im trying to make something for when you touch it theres a server announcement that someone won the game. could someone help?

spark seal
# light tendon im trying to make something for when you touch it theres a server announcement t...

-- Variables
local part = script.Parent -- The part that players touch
local messageService = game:GetService("ReplicatedStorage"):WaitForChild("MessageService") -- A RemoteEvent for announcements

-- Ensure a RemoteEvent exists in ReplicatedStorage
if not messageService then
messageService = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
messageService.Name = "MessageService"
end

-- Function to handle when the part is touched
local function onTouch(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- Check if a player touched the part

if player then
    -- Announce the player's win to the server
    messageService:FireAllClients(player.Name .. " has won the game! Congratulations!")
end

end

-- Connect the function to the Touched event
part.Touched:Connect(onTouch)

cursive flare
spark seal
spark seal
cursive flare
spark seal
cursive flare
#

Idk why people ask here instead of first searching up or using ai

spark seal
cursive flare
#

True

spark seal
cursive flare
#

Sure

spark seal
rich hedge
#

Scripting with your own intelligence is better

random steppe
cursive flare
#

when asking such a simple question

#

They should honestly use other sources first

#

It makes it easier for all of us

cursive flare
random steppe
#

😭

cursive flare
#

Instead of, say, asking it to create a script for you, ask it to correct ur script

#

Its not too good at making whole systems

cursive flare
#

Well then rely in Google and dev forums mainly

random steppe
#

i dont understand anything in those dev forums 😔

#

theyre too long for me

rich hedge
#

You should learn how it works and start using it too

cursive flare
#

Well that's cuz u know how to script, foe those who don't, use AI or search it up first

rich hedge
#

It's not that hard to type something which you don't know and read some text

#

That's how you use the documentation