Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
|
| 28 Dec 2015 02:19 PM |
Hey guys, I need a Surface Gui Model for a chat script, that will work across any server of your game. If you know a good one please put the link in a reply, or if you know a simple script that I can copy, just put it below. Thanks
Also, I need help with my teleporting script.
function onMouseButton1Down() -- LocalScript for Lobby place -- Declare local variables for ROBLOX Services local TeleportService = game:GetService('TeleportService') local UserInputService = game:GetService('UserInputService') local StarterGui = game.StarterGui -- Declare local variables local player = game.Players.LocalPlayer local otherPlaceId = script.PId.Value local forceField = Instance.new('ForceField') local teleportButton = script.Parent -- Create loading screen to fade in and pass with teleport function local loadingScreen = Instance.new('ScreenGui', player.PlayerGui) local loadingScreenFrame = Instance.new('Frame', loadingScreen) loadingScreenFrame.Name = 'loadingScreenFrame' loadingScreenFrame.BackgroundColor3 = Color3.new(0,0,0) loadingScreenFrame.Size = UDim2.new(1,0,1,50) loadingScreenFrame.Position = UDim2.new(0,0,0,-50) loadingScreenFrame.Visible = false -- Hide default teleport GUI elements TeleportService.CustomizedTeleportUI = true -- Bind function to OnTeleport in case teleport fails player.OnTeleport:connect(function(teleportState) if teleportState == Enum.TeleportState.Failed then -- Disable force field forceField.Parent = nil -- Hide teleport GUI and show teleport button loadingScreenFrame.BackgroundTransparency = 1 loadingScreenFrame.Visible = false teleportButton.Visible = true -- Show Core GUI elements and mouse cursor StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true) UserInputService.MouseIconEnabled = true end end) -- Bind function to GUI button teleportButton.MouseButton1Click:connect(function() -- Hide button, Core GUI, and mouse teleportButton.Visible = false StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false) UserInputService.MouseIconEnabled = false -- Activate force field to protect player during teleport forceField.Parent = player.Character -- Show loading screen and fade it in loadingScreenFrame.Visible = true for i = 1, 0, -.05 do loadingScreenFrame.BackgroundTransparency = i wait() end loadingScreenFrame.BackgroundTransparency = 0 -- Teleport player and pass the loading screen TeleportService:Teleport(otherPlaceId, player, nil, loadingScreen) end) end script.Parent.MouseButton1Down:connect(onMouseButton1Down)
~~Epic51783 |
|
|
| Report Abuse |
|
|
Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
|
| 28 Dec 2015 02:19 PM |
I mean, in studio the teleport script works perfectly fine, but in the actual game it doesn't work at all.
~~Epic51783 |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 02:22 PM |
are u using a local script?
--//GavAttack12 |
|
|
| Report Abuse |
|
|
Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
| |
|
|
| 28 Dec 2015 02:26 PM |
then use this: local player = script.Parent.Parent.Parent (IDK how many parents you need)
--//GavAttack12 |
|
|
| Report Abuse |
|
|
Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
|
| 28 Dec 2015 02:31 PM |
Would It still work if this script is under a button?
~~Epic51783 |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 02:32 PM |
it should already be in a button
--//GavAttack12 |
|
|
| Report Abuse |
|
|
Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
|
| 28 Dec 2015 02:35 PM |
Ik, its already under a button. I ment like its on a surface Gui.
~~Epic51783 |
|
|
| Report Abuse |
|
|
Epic51783
|
  |
| Joined: 22 May 2014 |
| Total Posts: 29 |
|
| |
|